/**
 * 
 */
package com.feib.stms.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.feib.stms.model.Securities;
import com.feib.stms.pagination.PaginatedList;

/**
 * @author Karl Chen
 *
 */
@Transactional(readOnly = true)
public interface SecuritiesService {
	/**
	 * 查詢分公司 
	 * @param securities
	 * @param paginatedList
	 * @return
	 */
	public PaginatedList<Securities> findForPaginatedListBySecurities(Securities securities, PaginatedList paginatedList);
	
	/**
	 * 根據分公司代號及所屬群組查詢分公司
	 * @param securitiesNo
	 * @param groupPk
	 * @return
	 */
	public Securities findForSecuritiesBySecuritiesNoAndGroupPk(String securitiesNo, Long groupPk);
	
	/**
	 * 根據分公司代號查詢分公司
	 * @param securitiesNo
	 * @param groupPk
	 * @return
	 */
	public Securities findForSecuritiesBySecuritiesNo(String securitiesNo);
	
	/**
	 * 根據群組查詢券商資料
	 * @param userGroupPk
	 * @return
	 */
	public List<Securities> findForSecuritiesListByGroupPks(List<String> userGroupPk);	
		
	/**
	 * 根據券商代號取得券商資料
	 * @param securitiesNo
	 * @return
	 */
	public List<Securities> findForSecuritiesListBySecuritiesNos(List<String> securitiesNo);
	
	/**
	 * 取得所有<strong>分公司</strong>資料。
	 * @param userGroupPk
	 * @return
	 */
	public List<Securities> findForListBySecurities();	
	
	/** 根據pk查詢
	 * @param SecuritiesPk
	 * @return Securities
	 */
	public Securities getBySecuritiesPk(Long securitiesPk);
	
	/** 新增分公司
	 * @param securities
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int saveSecurities(Securities securities);
	
	/** 修改分公司
	 * @param securities
	 * @return int
	 */
	@Transactional(readOnly = false)
	public int updateSecurities(Securities securities);
	
	/** 查詢母公司Pk
	 * @param groupPk
	 * @return long
	 */	
	public long findParentSecuritiesPk(Long groupPk);
	
	/**
	 * 取得所有資料
	 * @return
	 * @author Jimmy Liu
	 */
	public List<Securities> findAll();
	
	/** 查詢SecuritiesNo是否重複 --新增使用
	 * @param SecuritiesNo
	 * @return
	 */
	public int countSecuritiesNo(String securities_No);	
	
	/**
	 * 查詢分公司 (包含母公司)
	 * @param securities
	 * @param paginatedList
	 * @return
	 */
	public PaginatedList<Securities> findForPaginatedListNotBank(Securities securities, PaginatedList paginatedList);
	
	
}
